import React, { memo } from "react";
import MyTarbar from "../component/MyTarbar";
import MyNavbar from "../component/MyNavbar";
import { Button, Input, Form } from "react-vant";
import { useNavigate } from "react-router-dom";
const Login = memo(() => {
  let navigate = useNavigate();

  const deng = () => {
    localStorage.setItem("token", 123);
    navigate("/home");
  };
  return (
    <div>
      <MyNavbar></MyNavbar>
      <div>
        <Form
          layout="vertical"
          footer={
            <div style={{ margin: "16px 16px 0" }}>
              <Button
                round
                nativeType="submit"
                type="primary"
                block
                onClick={() => deng()}
              >
                立即登录
              </Button>
            </div>
          }
        >
          <Form.Item name="name" label="账号">
            <Input placeholder="请输入账号" />
          </Form.Item>
          <Form.Item
            initialValue={{ prefix: "86", value: "" }}
            name="mobile"
            label="密码"
          ></Form.Item>
        </Form>
      </div>
      <MyTarbar></MyTarbar>
    </div>
  );
});

export default Login;
